from rest_framework import serializers
from .models import DataSource, OPCUASubscription, MQTTSubscription

class DataSourceSerializer(serializers.ModelSerializer):
    class Meta:
        model = DataSource
        fields = '__all__'
        read_only_fields = ['created_by', 'created_at']

class OPCUASubscriptionSerializer(serializers.ModelSerializer):
    class Meta:
        model = OPCUASubscription
        fields = '__all__'
        read_only_fields = ['created_by', 'created_at']

class MQTTSubscriptionSerializer(serializers.ModelSerializer):
    class Meta:
        model = MQTTSubscription
        fields = '__all__'
        read_only_fields = ['created_by', 'created_at'] 